package com.mikao.dao;

import com.mikao.entity.UserSellOrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface UserSellOrderDao extends JpaRepository<UserSellOrder, Long>, JpaSpecificationExecutor {

    /**
     * 根据用户ID查找用户领种的果树
     *
     * @param userId id
     * @param type   订单类型
     * @return list
     */
    List<UserSellOrder> findAllByUserIdAndTypeAndIsPayedOrderByCreateTimeDesc(Long userId, Integer type, Boolean isPayed);
}
